package cn.lili.modules.payment.serviceimpl;

import cn.lili.modules.payment.entity.dos.OutOrderDetailLog;
import cn.lili.modules.payment.mapper.OutOrderDetailLogMapper;
import cn.lili.modules.payment.service.OutOrderDetailLogService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 分账记录 业务实现
 *
 * @author Chopper
 * @since 2020-12-19 09:25
 */
@Slf4j
@Service
public class OutOrderDetailLogServiceImpl extends ServiceImpl<OutOrderDetailLogMapper, OutOrderDetailLog> implements OutOrderDetailLogService {


    @Override
    public List<OutOrderDetailLog> getByOutOrderNo(String outOrderNo) {
        LambdaQueryWrapper<OutOrderDetailLog> query = new LambdaQueryWrapper<OutOrderDetailLog>();
        query.eq(OutOrderDetailLog::getOutOrderNo, outOrderNo);
        query.orderBy(true,true,
                OutOrderDetailLog::getId);
        return list(query);
    }

    @Override
    public List<OutOrderDetailLog> shareProfitStrike(String subMchid) {
        return this.baseMapper.shareProfitStrike(subMchid);
    }

    @Override
    public void deleteShareProfit(List<String> ids) {
        this.baseMapper.deleteShareProfit(ids);
    }
}
